3.1.43 \(\int \cos ^3(c+d x) (B \sec (c+d x)+C \sec ^2(c+d x)) \, dx\) [43]

Optimal. Leaf size=38 \[ \frac {B x}{2}+\frac {C \sin (c+d x)}{d}+\frac {B \cos (c+d x) \sin (c+d x)}{2 d} \]

[Out]

1/2*B*x+C*sin(d*x+c)/d+1/2*B*cos(d*x+c)*sin(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {4132, 2715, 8, 12, 2717} \begin {gather*} \frac {B \sin (c+d x) \cos (c+d x)}{2 d}+\frac {B x}{2}+\frac {C \sin (c+d x)}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^3*(B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

(B*x)/2 + (C*Sin[c + d*x])/d + (B*Cos[c + d*x]*Sin[c + d*x])/(2*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 2715

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Sin[c + d*x])^(n - 1)/(d*n))
, x] + Dist[b^2*((n - 1)/n), Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integ
erQ[2*n]

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 4132

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(
C_.)), x_Symbol] :> Dist[B/b, Int[(b*Csc[e + f*x])^(m + 1), x], x] + Int[(b*Csc[e + f*x])^m*(A + C*Csc[e + f*x
]^2), x] /; FreeQ[{b, e, f, A, B, C, m}, x]

Rubi steps

\begin {align*} \int \cos ^3(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=B \int \cos ^2(c+d x) \, dx+\int C \cos (c+d x) \, dx\\ &=\frac {B \cos (c+d x) \sin (c+d x)}{2 d}+\frac {1}{2} B \int 1 \, dx+C \int \cos (c+d x) \, dx\\ &=\frac {B x}{2}+\frac {C \sin (c+d x)}{d}+\frac {B \cos (c+d x) \sin (c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.05, size = 35, normalized size = 0.92 \begin {gather*} \frac {4 C \sin (c+d x)+B (2 (c+d x)+\sin (2 (c+d x)))}{4 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^3*(B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

(4*C*Sin[c + d*x] + B*(2*(c + d*x) + Sin[2*(c + d*x)]))/(4*d)

________________________________________________________________________________________

Maple [A]
time = 0.34, size = 38, normalized size = 1.00

method result size
risch \(\frac {B x}{2}+\frac {C \sin \left (d x +c \right )}{d}+\frac {B \sin \left (2 d x +2 c \right )}{4 d}\) \(32\)
derivativedivides \(\frac {B \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+C \sin \left (d x +c \right )}{d}\) \(38\)
default \(\frac {B \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+C \sin \left (d x +c \right )}{d}\) \(38\)
norman \(\frac {B x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {\left (B -2 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {\left (B +2 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {B x}{2}-B x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {B x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}-\frac {\left (B -2 C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (B +2 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}\) \(161\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^3*(B*sec(d*x+c)+C*sec(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d*(B*(1/2*cos(d*x+c)*sin(d*x+c)+1/2*d*x+1/2*c)+C*sin(d*x+c))

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 34, normalized size = 0.89 \begin {gather*} \frac {{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B + 4 \, C \sin \left (d x + c\right )}{4 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^3*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="maxima")

[Out]

1/4*((2*d*x + 2*c + sin(2*d*x + 2*c))*B + 4*C*sin(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 1.90, size = 29, normalized size = 0.76 \begin {gather*} \frac {B d x + {\left (B \cos \left (d x + c\right ) + 2 \, C\right )} \sin \left (d x + c\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^3*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="fricas")

[Out]

1/2*(B*d*x + (B*cos(d*x + c) + 2*C)*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (B + C \sec {\left (c + d x \right )}\right ) \cos ^{3}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**3*(B*sec(d*x+c)+C*sec(d*x+c)**2),x)

[Out]

Integral((B + C*sec(c + d*x))*cos(c + d*x)**3*sec(c + d*x), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 82 vs. \(2 (34) = 68\).
time = 0.46, size = 82, normalized size = 2.16 \begin {gather*} \frac {{\left (d x + c\right )} B - \frac {2 \, {\left (B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^3*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, algorithm="giac")

[Out]

1/2*((d*x + c)*B - 2*(B*tan(1/2*d*x + 1/2*c)^3 - 2*C*tan(1/2*d*x + 1/2*c)^3 - B*tan(1/2*d*x + 1/2*c) - 2*C*tan
(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 + 1)^2)/d

________________________________________________________________________________________

Mupad [B]
time = 2.45, size = 31, normalized size = 0.82 \begin {gather*} \frac {B\,x}{2}+\frac {B\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {C\,\sin \left (c+d\,x\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^3*(B/cos(c + d*x) + C/cos(c + d*x)^2),x)

[Out]

(B*x)/2 + (B*sin(2*c + 2*d*x))/(4*d) + (C*sin(c + d*x))/d

________________________________________________________________________________________